Answer:

count is 13
count is 14
count is 15
count is 16
count is 17

  . . . .

and so on without end

Infinite Loop

It is possible (and common) to accidently create a counting loop that never ends. In the above example, this happens because the variable decrement had the value minus one. So the statement

count = count - decrement;

actually added one to count. So count kept getting larger and larger, never reaching the zero that the condition part was looking for:

while ( count >= 0 )   // GREATER-than-or-equal operator

Such loops are called infinite loops, or non-terminating loops and are easy to overlook when you are programming. Here is another program fragment:

int count  = 20;
int dec    = -1;
while ( count __________ 10 )   // what  relational operator ?
{
  System.out.println( "count is:" + count );
  count = count + dec ;
}
System.out.println( "count was " + count + " when it failed the test");

QUESTION 9:

What relational operator should be used so that the program fragment prints out the integers 20 down to and including 11 ?